import { useReducer } from "react";
// export default initialState => {  这个写法会警告
export default (initialState) => {
  const _reducer = (state, action) => {
    return {
      ...state,
      ...action,
    };
  };

  const [state, dispatch] = useReducer(_reducer, initialState);
  return [state, dispatch];
};
